import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

export function delDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

export function getDepartmentDetail(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

export function updateDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

